package m.html.element;

import m.html.element.other.IElement;

public class Row extends Element {
	
	private boolean flex=false;
	public Row() {
		this(0);
	}
	public Row(int gutter) {
		super("a-row");
		super.A(":gutter", String.valueOf(gutter));
	}
	public Row(boolean flex) {
		super("a-row");
		if(flex) super.A("type","flex");
		this.flex=flex;
	}
	public Row addCol(IElement element,int span) {
		super.E(new Element("a-col")
			.A(this.flex?"flex":":span", String.valueOf(span))
			.E(element)
		);
		return this;
	}
	public Row addCol(IElement element,String flex) {
		super.E(new Element("a-col")
			.A(this.flex?"flex":":span", flex)
			.E(element)
		);
		return this;
	}
}
